package com.cap.cfae.utils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import commonj.sdo.DataObject;

public class BeanOperate {

	public static void main(String[] args) {

	}
    /**
     * 
     * @param dataObject 查询到的对象
     * @return objectMap 返回转换的map
     */
	public static Map<String, Object> getMap(DataObject dataObject) {
		Map<String, Object> objectMap = new HashMap<String, Object>();
		List<Object> propertiesList = dataObject.getInstanceProperties();
		for (Object property : propertiesList) {
			String pString = property.toString();
			String keyString = pString.substring(0, pString.indexOf("<"));
			objectMap.put(keyString, dataObject.getString(keyString));
		}
		return objectMap;
	}

}
